package demo3;


import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static void main(String[] args) {
        String date = "2015-04-11 12:45:14";
        /*创建一个简单日期格式格式化类，解析字符串成为一个日期对象*/
        ParseDate(date);
    }
    public static void ParseDate(String date){
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date d =  sdf.parse(date);
            System.out.println(d);
            InputStream is = new FileInputStream("E:/meinv.jpg");
        } catch (FileNotFoundException e) {
            e.printStackTrace();//打印栈信息异常
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
